﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace StudentsDreams.Game.View
{
    /// <summary>
    /// Логика взаимодействия для PauseMenuView.xaml
    /// </summary>
    public partial class PauseMenuView : UserControl
    {
        GameDefaultView gameDefault = new GameDefaultView();
        MainMenuView mainMenu = new MainMenuView();
        CommonSettingsView commonSetting = new CommonSettingsView();

        public PauseMenuView()
        {
            InitializeComponent();
        }

        /// <summary>
        /// Кнопка "Продолжить игру" 
        /// Возвращает в игру
        /// </summary>
        private void OnBtnContinueGameClick(object sender, RoutedEventArgs e)
        {
            this.Content = gameDefault;
        }

        /// <summary>
        /// Обработка клавиши Escape и возврат в игру
        /// </summary>
        private void PauseMenuKeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyboardDevice.IsKeyDown(Key.Escape))
            {
                this.Content = gameDefault;
            }
        }
        /// <summary>
        /// Кнопка "Главное меню"
        /// Переходит в Главное меню
        /// </summary>
        private void OnBtnManeMenuClick(object sender, RoutedEventArgs e)
        {
            this.Content = mainMenu;
        }

        /// <summary>
        /// Кнопка "Настройки"
        /// Переходит в меню настройки
        /// </summary>
        private void OnBtnSettingsClick(object sender, RoutedEventArgs e)
        {
            this.Content = commonSetting;
        }

        /// <summary>
        /// Кнопка "Выход"
        /// Выходит из игры
        /// </summary>
        private void OnBtnExitClick(object sender, RoutedEventArgs e)
        {
            Application.Current.Shutdown();
        }
    }
}
